#include<stdio.h>
int main(){
    int hour1, minute1;
    int hour2, minute2;

    printf("pleas input the first hour and minute:\n");
    scanf("%d %d", &hour1, &minute1);

    printf("pleas input the second hour and minute:\n");
    scanf("%d %d", &hour2, &minute2);

    int t1 = hour1*60 + minute1;
    int t2 = hour2*60 + minute2;

    int t = t2-t1;

    if(t>=0){
    printf("Time distance is %d hour and %d minute!",t/60, t%60);

    }else{

    printf("Time distance is %d hour and %d minute!",(-t)/60, (-t)%60);
    }

    return 0;
}